﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Admin.ViewModels.InsurerViewModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<%@ Import Namespace="SDT.Model"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Danh sách công ty bảo hành
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">	
	<%= Html.Toolbar("Thêm mới", "/Insurer/Create", "new")%>	
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Header" runat="server">
	Danh sách công ty bảo hành
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["Message"] != null ? "<p class='perror'>" + Html.Encode(ViewData["Message"]) + "</p>" : string.Empty%>  
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="/Scripts/ams.js" type="text/javascript"></script>
<form action="/Insurer/Index" method="post" name="InsurerForm">    
<table>
    <tr>            
        <td style="border:none;"><%=Html.TextBoxFor(m=>m.Keyword) %>&nbsp;&nbsp;<input id="btnSearch" type="submit" value="Tìm kiếm" /></td> 
             
    </tr>
</table>
   
<table style="border:none; font-weight: bold;" width="100%">
    <tbody>
        <tr>
			<td style="border:none;text-align: left">Tổng số công ty bảo hành: <%= Model.Insurers.TotalItemCount%></td>
			<td style="border:none;text-align: right;">Trang hiện tại: <%= Model.Insurers.PageCount > 0 ? Model.Insurers.PageIndex + 1 : 0%>/<%= Model.Insurers.PageCount%></td>
        </tr>
    </tbody>
</table>
<table style="width:100%" class="adminlist">
    <tr>
        <th style="text-align:center; width:3%">STT</th>
        <th style="width:30%">Tên công ty bảo hành</th>
        <th style="width:25%">Địa chỉ</th>
        <th style="width:15%">Số điện thoại</th>
        <th style="width:18%">Email</th>
        <th style="text-align:center;width:7%">Xóa</th>
    </tr>
    <%int index = Model.Insurers.PageIndex * Model.Insurers.PageSize + 1;
      foreach (var item in Model.Insurers)
      { %>
        <tr>
            <td style="text-align:center;"><%=index++ %></td>
            <td>
                <%=Html.ActionLink(item.Name, "Edit", new { id = item.ID })%>
            </td>
            <td><%=Html.Encode(item.Address) %></td>
            <td><%=Html.Encode(item.Phone) %></td>
            <td><%=item.Email %></td>
            <td style="text-align:center;"><a href="/Insurer/Delete/<%=item.ID %>"><img src="/Images/delete22.png" alt="Xóa" /></a></td>
        </tr>
     <% } %>
     <tfoot>
            <tr>
                <td colspan="6" align="center" class="pager">
                        <label>Hiển thị #</label>
                        <%
                            int[] pageSizeList = {5, 10, 15, 20, 25, 50, 100};
                        %>
                        <%= Html.DropDownList("pageSize", new SelectList(pageSizeList, Model.Insurers.PageSize), new { onchange = "document.InsurerForm.submit();" })%>
                        <%= Html.Pager(Model.Insurers.PageSize, Model.Insurers.PageNumber, Model.Insurers.TotalItemCount, new { pageSize = Model.Insurers.PageSize, key = Model.Keyword })%>
                </td>
            </tr>
        </tfoot>
</table>
</form>
</asp:Content>
